/*global module:false*/
module.exports = function (grunt) {
    var baseDir = '/Users/tiny_moo/Workspace/suge/assets/v1/';
    var srcDir = baseDir + 'src/';
    var buildDir = baseDir + 'build/';

    grunt.initConfig({
        meta: {
            version: '0.1.0',
            banner: '/*! PROJECT_NAME - v<%= meta.version %> - ' +
                '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
                '* http://PROJECT_WEBSITE/\n' +
                '* Copyright (c) <%= grunt.template.today("yyyy") %> ' +
                'YOUR_NAME; Licensed MIT */'
        },
        less: {
            home: {
                options: {
                    yuicompress: true
                },
                files: [
                    {
                        src: [srcDir + 'css/home.less'],
                        dest: buildDir + 'tmp/home.css'
                    }
                ]

            }
        },
        concat: {
            options: {
                separator: ''
            },
            home: {
                files: [
                    {
                        src: [baseDir + 'yui/reset-min.css', buildDir + 'tmp/home.css'],
                        dest: buildDir + 'home.css'
                    }
                ]}
        },
        uglify: {
            options: {
                beautify: {
                    ascii_only: true
                }
            },
            card_js: {
                src: [buildDir + 'tmp/card.js'],
                dest: buildDir + 'tb_home/card-min.js'
            },
            phone_js: {

                src: [buildDir + 'tmp/phone.js'],
                dest: buildDir + 'tb_home/phone-min.js'
            },
            qq_js: {
                src: [buildDir + 'tmp/qq.js'],
                dest: buildDir + 'tb_home/qq-min.js'
            }
        },
        clean: {
            home: {
                src: [buildDir + 'tmp']
            }
        },
        jshint: {
            options: {
                curly: true,
                eqeqeq: false,
                immed: true,
                latedef: true,
                newcap: true,
                noarg: true,
                sub: true,
                undef: true,
                boss: true,
                eqnull: true,
                browser: true
            },
            globals: {}
        }
    });

    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-less');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-contrib-livereload');

    // Default task.
    grunt.registerTask('default', ['less:home', 'concat:home', 'clean:home']);

};
